﻿using SanJ.FreeCare.ValueSets;
using System;
using Volo.Abp;
using Volo.Abp.Domain.Entities.Auditing;
using Volo.Abp.MultiTenancy;

namespace SanJ.FreeCare.ObservationDefinitions
{
    /// <summary>
    /// 观测定义实体，即护理记录,评估项目,体检项目等
    /// </summary>
    public class ObservationDefinition : AuditedAggregateRoot<Guid>, IMultiTenant, ISoftDelete
    {
        /// <summary>
        /// 项目名称
        /// </summary>
        public string Name { get; set; }
        /// <summary>
        /// 助记码
        /// </summary>
        public string Spell { get; set; }
        /// <summary>
        /// 父节点id
        /// </summary>
        public Guid? ParentId { get; set; }
        /// <summary>
        /// 项目编码(树状编码)自动生成
        /// </summary>
        public string Code { get; set; }
        /// <summary>
        /// 项目状态 是否有效
        /// </summary>
        public string IsVaild { get; set; }
        /// <summary>
        /// 使用的上下文
        /// </summary>
        public string? Context { get; set; }
        /// <summary>
        /// 允许的数据类型, json数组 double string
        /// </summary>
        public string? PermittedDataType { get; set; }
        /// <summary>
        /// 项目分类 json数组 
        /// </summary>
        public string? Category { get; set; }
        /// <summary>
        /// 项目类型 即checked select input 
        /// </summary>
        public string? UiControlType { get; set; }
        /// <summary>
        /// 单位 支持多个 Json数组存储
        /// </summary>
        public string? PermittedUnit { get; set; }
        /// <summary>
        /// 报告内名称
        /// </summary>
        public string? PreferredReportName { get; set; }
        /// <summary>
        /// 项目详细描述
        /// </summary>
        public string? Description { get; set; }

        /// <summary>
        /// 显示顺序
        /// </summary>
        public int? DisplayOrder { get; set; }

        public bool IsDeleted { get; set; }

        public Guid? TenantId { get; set; }

        /// <summary>
        /// 备注
        /// </summary>
        public string Note { get; set; }

        /// <summary>
        /// 性别
        /// </summary>
        public bool Gerden { get; set; }

        /// <summary>
        /// 原价
        /// </summary>
        public string OriginalePrice { get; set; }

        /// <summary>
        /// 优惠价
        /// </summary>
        public string PreferentialPrice { get; set; }

        public ObservationDefinition() { }


        public ObservationDefinition(
            Guid parentId,
            string name,
            string spell,
            string code,
            string category,
            string description,
            string? permittedDataType,
            string permittedUnit,
            int? displayOrder,
            string note,
            bool gerden,
            string originalePrice,
            string preferntialPrice
            )
        {
            this.ParentId = parentId;
            this.Id = Guid.NewGuid();
            this.Name = name;
            this.Spell = spell;
            this.Code = code;
            this.Category = category;
            this.Description = description;
            this.PermittedDataType = permittedDataType;
            this.PermittedUnit = permittedUnit;
            this.DisplayOrder = displayOrder;
            this.IsVaild = VaildType.Vaild;
            this.OriginalePrice = originalePrice;
            this.Note = note;
            this.Gerden = gerden;
            this.PreferentialPrice = preferntialPrice;
        }

    }
}
